/*
 ------------------------------------------------------------------------------
 Copyright (C) 2006-2007 Team Blur.

 This file is part of the Quantum Engine source code.

 The Quantum Engine source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Quantum Engine source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Quantum Engine source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


#ifndef __FRAMEWORK_GAME_H__
#define __FRAMEWORK_GAME_H__


// Absolute limits
#define MAX_CLIENTS					64
#define MAX_ENTITIES				4096

#define MAX_NAME_LENGTH				64			// Max length of a player name

// Number of packets that must be kept on both client and server for delta
// compression and ping estimation
#define PACKET_BACKUP				32
#define PACKET_MASK					(PACKET_BACKUP - 1)

/*
 ==============================================================================

 USER COMMAND

 ==============================================================================
*/

// Allow a lot of user command backups for very fast systems
#define	USERCMD_BACKUP				64
#define USERCMD_MASK				(USERCMD_BACKUP - 1)

typedef enum {
	UCF_RUNNING						= BIT(0),
	UCF_TALKING						= BIT(1)
} userCmdFlags_t;

typedef enum {
	BUTTON_ATTACK					= BIT(0),
	BUTTON_ATTACK_ALT				= BIT(1),
	BUTTON_RELOAD					= BIT(2),
	BUTTON_WEAPON_PREV				= BIT(3),
	BUTTON_WEAPON_NEXT				= BIT(4),
	BUTTON_WEAPON_LAST				= BIT(5),
	BUTTON_WEAPON_1					= BIT(6),
	BUTTON_WEAPON_2					= BIT(7),
	BUTTON_WEAPON_3					= BIT(8),
	BUTTON_WEAPON_4					= BIT(9),
	BUTTON_WEAPON_5					= BIT(10),
	BUTTON_WEAPON_6					= BIT(11),
	BUTTON_WEAPON_7					= BIT(12),
	BUTTON_WEAPON_8					= BIT(13),
	BUTTON_WEAPON_9					= BIT(14),
	BUTTON_WEAPON_10				= BIT(15),
	BUTTON_WEAPON_11				= BIT(16),
	BUTTON_WEAPON_12				= BIT(17),
	BUTTON_WEAPON_13				= BIT(18),
	BUTTON_WEAPON_14				= BIT(19),
	BUTTON_WEAPON_15				= BIT(20),
	BUTTON_WEAPON_16				= BIT(21),
	BUTTON_ZOOM_IN					= BIT(22),
	BUTTON_ZOOM_OUT					= BIT(23),
	BUTTON_USE						= BIT(24),
	BUTTON_DROP						= BIT(25),
	BUTTON_LEAN_LEFT				= BIT(26),
	BUTTON_LEAN_RIGHT				= BIT(27),
	BUTTON_SPRINT					= BIT(28),
	BUTTON_PRONE					= BIT(29),
	BUTTON_RADAR					= BIT(30),
	BUTTON_SCORES					= BIT(31)
} buttonBits_t;

typedef struct {
	int						time;
	int						flags;
	int						buttons;

	short					forwardMove;
	short					rightMove;
	short					upMove;

	short					angles[3];
} userCmd_t;


#endif	// __FRAMEWORK_GAME_H__
